<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@ taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@ taglib prefix="sb" uri="/struts-bootstrap-tags"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<s:include value="/WEB-INF/content/common/header.jsp"></s:include>
</head>
<body class="bg">
	<div class="container">
		<s:include value="/WEB-INF/content/common/title-head.jsp"></s:include>

		<div class="content">

			<s:include value="/WEB-INF/content/common/tab.jsp"></s:include>

			<script>
				$("#userGroupTab").addClass("active");
			</script>

			<div id="body">
				<div class="row">
					<div class="col-lg-10 col-lg-offset-1">
						<div class="span10 title">
							<h2>
								<s:text name="page.heading.list" />
							</h2>
						</div>
						<div class="create-area right">
							<s:url action="add" namespace="/group" var="addUrl" />
							<s:a href="%{#addUrl}" cssClass="btn btn-mini btn-primary">
								<s:text name="global.add" />
							</s:a>
						</div>
						<s:actionerror />
						<table class="table table-striped">
							<thead>
								<tr>
									<th><s:text name="" /></th>
									<th class="nowrap"><s:text name="group.groupName" /></th>
									<th class="nowrap"><s:text name="group.user" /></th>
									<th class="nowrap"><s:text name="global.last.update" /></th>
									<th></th>
								</tr>
							</thead>
							<tbody>
								<s:iterator value="pager.list" status="rowIndexLevel1">
									<s:url var="viewUrl" action="view" namespace="/group"
										includeParams="none">
										<s:param name="id" value="%{userGroup.id}" />
									</s:url>
									<s:url var="editUrl" action="edit" namespace="/group"
										includeParams="none" escapeAmp="false">
										<s:param name="id" value="%{userGroup.id}" />
									</s:url>
									<tr>
										<td><s:property
												value="%{pager.start + #rowIndexLevel1.index + 1}" />
										<td class="nowrap"><s:a href="%{#viewUrl}">
												<s:property value="userGroup.groupName" />
											</s:a></td>
										<td><s:iterator value="users" status="rowIndexLevel2">
												<s:if test="#rowIndexLevel2.index < numberOfSubItemsInList">
													<s:property value="name" />
													<s:if
														test="!#rowIndexLevel2.isLast() && !(#rowIndexLevel2.index == (numberOfSubItemsInList - 1))">
														,&nbsp;&nbsp;
													</s:if>
												</s:if>
												<s:elseif
													test="#rowIndexLevel2.index == numberOfSubItemsInList">
														...
												</s:elseif>
											</s:iterator></td>
										<td class="nowrap"><s:date
												name="userGroup.updateDatetime" format="yyyy/MM/dd" /></td>

										<td class="nowrap"><s:a href="%{#editUrl}"
												cssClass="btn btn-mini btn-primary">
												<s:property value="%{getText('global.edit')}" />
											</s:a></td>
									</tr>
								</s:iterator>
							</tbody>
						</table>
					</div>
					<s:include value="/WEB-INF/content/common/pager.jsp"></s:include>
				</div>
			</div>
		</div>
		<s:include value="/WEB-INF/content/common/footer.jsp"></s:include>
	</div>
</body>
</html>